<%= form_for @event, html: {class: 'form-horizontal'} do |f|%>

  <div class="form-group"><label class="col-sm-2 control-label">活动名称</label>
    <div class="col-sm-3"> <%=f.text_field :name, class: 'form-control'%> </div>
  </div>

  <div class="form-group"><label class="col-sm-2 control-label">活动日期</label>
    <div class="col-sm-3">
      <div class="input-daterange input-group" id="datepicker">
        <%= f.text_field :start, class: 'input-sm form-control'%>
        <span class="input-group-addon">to</span>
        <%= f.text_field :end, class: 'input-sm form-control'%>
      </div>
    </div>
  </div>

  <div class="form-group"><label class="col-sm-2 control-label">活动地址</label>
    <div class="col-sm-5"> <%=f.text_field :location, class: 'form-control'%> </div>
  </div>

  <div class="form-group"><label class="col-sm-2 control-label">活动网站</label>
    <div class="col-sm-5"> <%=f.url_field :event_link, class: 'form-control'%> </div>
  </div>

  <div class="form-group"><label class="col-sm-2 control-label">活动描述</label>
    <div class="col-sm-5"> <%=f.text_area :desc, class: 'form-control'%> </div>
  </div>

  <div class="form-group">
    <div class="col-sm-4 col-sm-offset-2">
      <%=link_to '取消', events_path, class: 'btn btn-white'%>
      <%= button_tag (@event.new_record? ? '创建活动' : '保存'), class: 'btn btn-primary'%>
    </div>
  </div>

<% end %>

